<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    <div class="box">
        <p>段落</p>
    </div>
</body>
<script>

    var box = document.querySelector(".box");

    // 创建
    var span = document.createElement("span");
    // 插入
    box.appendChild(span);

    span.innerHTML = "hello";

    span.style.background = "red";

    // 删除
    // box.remove();
    // document.body.removeChild( box );

    // 修改
    console.log(box.outerHTML);
    box.outerHTML = "<span>"+ box.innerHTML +"</span>"
    
</script>
</html>